<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Doxygen: Model</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Doxygen
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'搜索','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','搜索');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('group__model.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#nested-classes">类</a> &#124;
<a href="#func-members">函数</a>  </div>
  <div class="headertitle">
<div class="title">Model</div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
类</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmets_1_1feasible__solution.html">mets::feasible_solution</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">interface of a feasible solution space to be searched with tabu search.  <a href="classmets_1_1feasible__solution.html#details">更多...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmets_1_1evaluable__solution.html">mets::evaluable_solution</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">A copyable and evaluable solution implementation,  <a href="classmets_1_1evaluable__solution.html#details">更多...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmets_1_1permutation__problem.html">mets::permutation_problem</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">An abstract permutation problem.  <a href="classmets_1_1permutation__problem.html#details">更多...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmets_1_1move.html">mets::move</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Move to be operated on a feasible solution.  <a href="classmets_1_1move.html#details">更多...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmets_1_1mana__move.html">mets::mana_move</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">A Mana Move is a move that can be automatically made tabu by the <a class="el" href="classmets_1_1simple__tabu__list.html" title="Simplistic implementation of a tabu-list.">mets::simple_tabu_list</a>.  <a href="classmets_1_1mana__move.html#details">更多...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmets_1_1swap__neighborhood.html">mets::swap_neighborhood&lt; random_generator &gt;</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Generates a stochastic subset of the neighborhood.  <a href="classmets_1_1swap__neighborhood.html#details">更多...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmets_1_1swap__elements.html">mets::swap_elements</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">A <a class="el" href="classmets_1_1mana__move.html" title="A Mana Move is a move that can be automatically made tabu by the mets::simple_tabu_list.">mets::mana_move</a> that swaps two elements in a <a class="el" href="classmets_1_1permutation__problem.html" title="An abstract permutation problem.">mets::permutation_problem</a>.  <a href="classmets_1_1swap__elements.html#details">更多...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmets_1_1invert__subsequence.html">mets::invert_subsequence</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">A <a class="el" href="classmets_1_1mana__move.html" title="A Mana Move is a move that can be automatically made tabu by the mets::simple_tabu_list.">mets::mana_move</a> that swaps a subsequence of elements in a <a class="el" href="classmets_1_1permutation__problem.html" title="An abstract permutation problem.">mets::permutation_problem</a>.  <a href="classmets_1_1invert__subsequence.html#details">更多...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmets_1_1move__manager.html">mets::move_manager</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">A neighborhood generator.  <a href="classmets_1_1move__manager.html#details">更多...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmets_1_1swap__full__neighborhood.html">mets::swap_full_neighborhood</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Generates a the full swap neighborhood.  <a href="classmets_1_1swap__full__neighborhood.html#details">更多...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmets_1_1invert__full__neighborhood.html">mets::invert_full_neighborhood</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Generates a the full subsequence inversion neighborhood.  <a href="classmets_1_1invert__full__neighborhood.html#details">更多...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
函数</h2></td></tr>
<tr class="memitem:gacfbb156f3953666fe3ee538ceb770f65"><td class="memTemplParams" colspan="2">template&lt;typename random_generator &gt; </td></tr>
<tr class="memitem:gacfbb156f3953666fe3ee538ceb770f65"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="group__model.html#gacfbb156f3953666fe3ee538ceb770f65">mets::random_shuffle</a> (<a class="el" href="classmets_1_1permutation__problem.html">permutation_problem</a> &amp;p, random_generator &amp;rng)</td></tr>
<tr class="memdesc:gacfbb156f3953666fe3ee538ceb770f65"><td class="mdescLeft">&#160;</td><td class="mdescRight">Shuffle a permutation problem (generates a random starting point).  <a href="group__model.html#gacfbb156f3953666fe3ee538ceb770f65">更多...</a><br /></td></tr>
<tr class="separator:gacfbb156f3953666fe3ee538ceb770f65"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga36dfb89bf6fb84702f7d021426b3f039"><td class="memTemplParams" colspan="2">template&lt;typename random_generator &gt; </td></tr>
<tr class="memitem:ga36dfb89bf6fb84702f7d021426b3f039"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="group__model.html#ga36dfb89bf6fb84702f7d021426b3f039">mets::perturbate</a> (<a class="el" href="classmets_1_1permutation__problem.html">permutation_problem</a> &amp;p, unsigned int n, random_generator &amp;rng)</td></tr>
<tr class="memdesc:ga36dfb89bf6fb84702f7d021426b3f039"><td class="mdescLeft">&#160;</td><td class="mdescRight">Perturbate a problem with n swap moves.  <a href="group__model.html#ga36dfb89bf6fb84702f7d021426b3f039">更多...</a><br /></td></tr>
<tr class="separator:ga36dfb89bf6fb84702f7d021426b3f039"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gadf750e2f7c7ff73f7d3e3d9bedc3e417"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__model.html#gadf750e2f7c7ff73f7d3e3d9bedc3e417">mets::swap_neighborhood&lt; random_generator &gt;::swap_neighborhood</a> (random_generator &amp;r, unsigned int moves)</td></tr>
<tr class="memdesc:gadf750e2f7c7ff73f7d3e3d9bedc3e417"><td class="mdescLeft">&#160;</td><td class="mdescRight">A neighborhood exploration strategy for <a class="el" href="classmets_1_1swap__elements.html" title="A mets::mana_move that swaps two elements in a mets::permutation_problem.">mets::swap_elements</a>.  <a href="group__model.html#gadf750e2f7c7ff73f7d3e3d9bedc3e417">更多...</a><br /></td></tr>
<tr class="separator:gadf750e2f7c7ff73f7d3e3d9bedc3e417"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga5bb7936b6ad1ff51e8574996f77d457f"><td class="memItemLeft" align="right" valign="top"><a id="ga5bb7936b6ad1ff51e8574996f77d457f"></a>
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__model.html#ga5bb7936b6ad1ff51e8574996f77d457f">mets::swap_neighborhood&lt; random_generator &gt;::~swap_neighborhood</a> ()</td></tr>
<tr class="memdesc:ga5bb7936b6ad1ff51e8574996f77d457f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Dtor. <br /></td></tr>
<tr class="separator:ga5bb7936b6ad1ff51e8574996f77d457f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga9ece6da99a38121877de3e4f6c36293c"><td class="memItemLeft" align="right" valign="top"><a id="ga9ece6da99a38121877de3e4f6c36293c"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__model.html#ga9ece6da99a38121877de3e4f6c36293c">mets::swap_neighborhood&lt; random_generator &gt;::refresh</a> (<a class="el" href="classmets_1_1feasible__solution.html">mets::feasible_solution</a> &amp;s)</td></tr>
<tr class="memdesc:ga9ece6da99a38121877de3e4f6c36293c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Selects a different set of moves at each iteration. <br /></td></tr>
<tr class="separator:ga9ece6da99a38121877de3e4f6c36293c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gae36fd69f7106de490bab4d5fe527481a"><td class="memItemLeft" align="right" valign="top"><a id="gae36fd69f7106de490bab4d5fe527481a"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>mets::swap_neighborhood&lt; random_generator &gt;::randomize_move</b> (<a class="el" href="classmets_1_1swap__elements.html">swap_elements</a> &amp;m, unsigned int <a class="el" href="classmets_1_1move__manager.html#a07f46fd5f66246612d7595e78329f6d2">size</a>)</td></tr>
<tr class="separator:gae36fd69f7106de490bab4d5fe527481a"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">详细描述</h2>
<h2 class="groupheader">函数说明</h2>
<a id="ga36dfb89bf6fb84702f7d021426b3f039"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga36dfb89bf6fb84702f7d021426b3f039">&#9670;&nbsp;</a></span>perturbate()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename random_generator &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">void mets::perturbate </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classmets_1_1permutation__problem.html">permutation_problem</a> &amp;&#160;</td>
          <td class="paramname"><em>p</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>n</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">random_generator &amp;&#160;</td>
          <td class="paramname"><em>rng</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Perturbate a problem with n swap moves. </p>
<dl class="section see"><dt>参见</dt><dd><a class="el" href="classmets_1_1permutation__problem.html" title="An abstract permutation problem.">mets::permutation_problem</a> </dd></dl>
<div class="fragment"><div class="line"><a name="l00282"></a><span class="lineno">  282</span>&#160;  {</div>
<div class="line"><a name="l00283"></a><span class="lineno">  283</span>&#160;<span class="preprocessor">#if defined (METSLIB_TR1_BOOST)</span></div>
<div class="line"><a name="l00284"></a><span class="lineno">  284</span>&#160;    boost::uniform_int&lt;&gt; int_range;</div>
<div class="line"><a name="l00285"></a><span class="lineno">  285</span>&#160;<span class="preprocessor">#elif defined (METSLIB_HAVE_UNORDERED_MAP) &amp;&amp; !defined (METSLIB_TR1_MIXED_NAMESPACE)</span></div>
<div class="line"><a name="l00286"></a><span class="lineno">  286</span>&#160;    std::uniform_int&lt;&gt; int_range;</div>
<div class="line"><a name="l00287"></a><span class="lineno">  287</span>&#160;<span class="preprocessor">#else</span></div>
<div class="line"><a name="l00288"></a><span class="lineno">  288</span>&#160;    std::tr1::uniform_int&lt;&gt; int_range;</div>
<div class="line"><a name="l00289"></a><span class="lineno">  289</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00290"></a><span class="lineno">  290</span>&#160;    <span class="keywordflow">for</span>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> ii=0; ii!=n;++ii) </div>
<div class="line"><a name="l00291"></a><span class="lineno">  291</span>&#160;      {</div>
<div class="line"><a name="l00292"></a><span class="lineno">  292</span>&#160;    <span class="keywordtype">int</span> p1 = int_range(rng, p.size());</div>
<div class="line"><a name="l00293"></a><span class="lineno">  293</span>&#160;    <span class="keywordtype">int</span> p2 = int_range(rng, p.size());</div>
<div class="line"><a name="l00294"></a><span class="lineno">  294</span>&#160;    <span class="keywordflow">while</span>(p1 == p2) </div>
<div class="line"><a name="l00295"></a><span class="lineno">  295</span>&#160;      p2 = int_range(rng, p.size());</div>
<div class="line"><a name="l00296"></a><span class="lineno">  296</span>&#160;    p.apply_swap(p1, p2);</div>
<div class="line"><a name="l00297"></a><span class="lineno">  297</span>&#160;      }</div>
<div class="line"><a name="l00298"></a><span class="lineno">  298</span>&#160;  }</div>
</div><!-- fragment -->
</div>
</div>
<a id="gacfbb156f3953666fe3ee538ceb770f65"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gacfbb156f3953666fe3ee538ceb770f65">&#9670;&nbsp;</a></span>random_shuffle()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename random_generator &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">void mets::random_shuffle </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classmets_1_1permutation__problem.html">permutation_problem</a> &amp;&#160;</td>
          <td class="paramname"><em>p</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">random_generator &amp;&#160;</td>
          <td class="paramname"><em>rng</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Shuffle a permutation problem (generates a random starting point). </p>
<dl class="section see"><dt>参见</dt><dd><a class="el" href="classmets_1_1permutation__problem.html" title="An abstract permutation problem.">mets::permutation_problem</a> </dd></dl>
<div class="fragment"><div class="line"><a name="l00259"></a><span class="lineno">  259</span>&#160;  {</div>
<div class="line"><a name="l00260"></a><span class="lineno">  260</span>&#160;<span class="preprocessor">#if defined (METSLIB_TR1_BOOST)</span></div>
<div class="line"><a name="l00261"></a><span class="lineno">  261</span>&#160;    boost::uniform_int&lt;size_t&gt; unigen;</div>
<div class="line"><a name="l00262"></a><span class="lineno">  262</span>&#160;    boost::variate_generator&lt;random_generator&amp;,</div>
<div class="line"><a name="l00263"></a><span class="lineno">  263</span>&#160;      boost::uniform_int&lt;size_t&gt; &gt;gen(rng, unigen);</div>
<div class="line"><a name="l00264"></a><span class="lineno">  264</span>&#160;<span class="preprocessor">#elif defined (METSLIB_HAVE_UNORDERED_MAP) &amp;&amp; !defined (METSLIB_TR1_MIXED_NAMESPACE)</span></div>
<div class="line"><a name="l00265"></a><span class="lineno">  265</span>&#160;    std::uniform_int&lt;size_t&gt; unigen;</div>
<div class="line"><a name="l00266"></a><span class="lineno">  266</span>&#160;    std::variate_generator&lt;random_generator&amp;, </div>
<div class="line"><a name="l00267"></a><span class="lineno">  267</span>&#160;      std::uniform_int&lt;size_t&gt; &gt;gen(rng, unigen);</div>
<div class="line"><a name="l00268"></a><span class="lineno">  268</span>&#160;<span class="preprocessor">#else</span></div>
<div class="line"><a name="l00269"></a><span class="lineno">  269</span>&#160;    std::tr1::uniform_int&lt;size_t&gt; unigen;</div>
<div class="line"><a name="l00270"></a><span class="lineno">  270</span>&#160;    std::tr1::variate_generator&lt;random_generator&amp;, </div>
<div class="line"><a name="l00271"></a><span class="lineno">  271</span>&#160;      std::tr1::uniform_int&lt;size_t&gt; &gt;gen(rng, unigen);</div>
<div class="line"><a name="l00272"></a><span class="lineno">  272</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00273"></a><span class="lineno">  273</span>&#160;    <a class="code" href="group__model.html#gacfbb156f3953666fe3ee538ceb770f65">std::random_shuffle</a>(p.pi_m.begin(), p.pi_m.end(), gen);</div>
<div class="line"><a name="l00274"></a><span class="lineno">  274</span>&#160;    p.update_cost();</div>
<div class="line"><a name="l00275"></a><span class="lineno">  275</span>&#160;  }</div>
<div class="ttc" id="agroup__model_html_gacfbb156f3953666fe3ee538ceb770f65"><div class="ttname"><a href="group__model.html#gacfbb156f3953666fe3ee538ceb770f65">mets::random_shuffle</a></div><div class="ttdeci">void random_shuffle(permutation_problem &amp;p, random_generator &amp;rng)</div><div class="ttdoc">Shuffle a permutation problem (generates a random starting point).</div><div class="ttdef"><b>Definition:</b> model.hh:258</div></div>
</div><!-- fragment -->
</div>
</div>
<a id="gadf750e2f7c7ff73f7d3e3d9bedc3e417"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gadf750e2f7c7ff73f7d3e3d9bedc3e417">&#9670;&nbsp;</a></span>swap_neighborhood()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename random_generator &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classmets_1_1swap__neighborhood.html">mets::swap_neighborhood</a>&lt; random_generator &gt;::<a class="el" href="classmets_1_1swap__neighborhood.html">swap_neighborhood</a> </td>
          <td>(</td>
          <td class="paramtype">random_generator &amp;&#160;</td>
          <td class="paramname"><em>r</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>moves</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>A neighborhood exploration strategy for <a class="el" href="classmets_1_1swap__elements.html" title="A mets::mana_move that swaps two elements in a mets::permutation_problem.">mets::swap_elements</a>. </p>
<p>This strategy selects <em>moves</em> random swaps</p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">r</td><td>a random number generator (e.g. an instance of std::tr1::minstd_rand0 or std::tr1::mt19936)</td></tr>
    <tr><td class="paramname">moves</td><td>the number of swaps to add to the exploration </td></tr>
  </table>
  </dd>
</dl>
<div class="fragment"><div class="line"><a name="l00597"></a><span class="lineno">  597</span>&#160;                 : <a class="code" href="classmets_1_1move__manager.html">mets::move_manager</a>(), rng(r), int_range(0), n(moves)</div>
<div class="line"><a name="l00598"></a><span class="lineno">  598</span>&#160;  { </div>
<div class="line"><a name="l00599"></a><span class="lineno">  599</span>&#160;    <span class="comment">// n simple moves</span></div>
<div class="line"><a name="l00600"></a><span class="lineno">  600</span>&#160;    <span class="keywordflow">for</span>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> ii = 0; ii != n; ++ii) </div>
<div class="line"><a name="l00601"></a><span class="lineno">  601</span>&#160;      <a class="code" href="classmets_1_1move__manager.html#a764ca3061b1f019b5508fc03323fd501">moves_m</a>.push_back(<span class="keyword">new</span> swap_elements(0,0));</div>
<div class="line"><a name="l00602"></a><span class="lineno">  602</span>&#160;  }  </div>
<div class="ttc" id="aclassmets_1_1move__manager_html"><div class="ttname"><a href="classmets_1_1move__manager.html">mets::move_manager</a></div><div class="ttdoc">A neighborhood generator.</div><div class="ttdef"><b>Definition:</b> model.hh:508</div></div>
<div class="ttc" id="aclassmets_1_1move__manager_html_a764ca3061b1f019b5508fc03323fd501"><div class="ttname"><a href="classmets_1_1move__manager.html#a764ca3061b1f019b5508fc03323fd501">mets::move_manager::moves_m</a></div><div class="ttdeci">std::deque&lt; move * &gt; moves_m</div><div class="ttdoc">The moves queue</div><div class="ttdef"><b>Definition:</b> model.hh:543</div></div>
</div><!-- fragment -->
</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">制作者 <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
  </ul>
</div>
</body>
</html>
